package logger

import (
	"log"
	_ "os"
	"runtime"
)

func PanicHandler() {
	if e := recover(); e != nil {
		for i := 3; i < 5; i++ {
			_, file, line, ok := runtime.Caller(i + 1)
			if ok {
				log.Println("[DEBUG:PANIC]", " at", file, "  ", line)
			}
		}
		log.Println("[DEBUG:PANIC] ", e)
	}
}
func LogDebugError(c interface{}) {
	for i := 0; i < 1; i++ {
		_, file, line, ok := runtime.Caller(i + 1)
		if ok {
			log.Println("[DEBUG:ERROR]", file, "  ", line,c)
		}
	}
}
func LogRealeaseError(c ...[]interface{}) {
	log.Println("[INFO:ERROR]", c)
}
func LogRealeaseErrorS(c string) {
	for i := 0; i < 1; i++ {
		_, file, line, ok := runtime.Caller(i + 1)
		if ok {
			log.Println("[DEBUG:ERROR]", file, "  ", line)
		}
	}
	log.Println("[DEBUG:ERROR]", c)

}
func LogRealeaseInfo(c ...interface{}) {
	for i := 0; i < 1; i++ {
		_, file, line, ok := runtime.Caller(i + 1)
		if ok {
			log.Println("[Release:INFO]", file, "  ", line, c)
		}
	}
}
